import style from '@/assets/home.module.scss';

import {} from '@/components';

export interface ProjectProps {
    children?: string | React.ReactElement | React.ReactElement[];
    data: {
        address: string;
        city: string;
        id: number;
        img: string;
        msg: string;
        name: string;
        openTime: string;
        price: number;
        province: string;
    };
}

function Project({ children, data }: ProjectProps) {
    console.log(time().format('{YYYY} HH:mm:ss'), `trend-item render`);

    const history = withRouter();
    return (
        <>
            <div
                className={`${style['trend-item']}`}
                onClick={() => {
                    history.push(`/place/${data.id}`);
                }}>
                <div className={`${style['img']}`}>
                    <img src={data.img} alt='' />
                </div>
                <div>
                    <p>{data.name}</p>
                    <p>
                        <span>
                            {data.province} . {data.city}
                        </span>
                    </p>
                    <p>{data.msg}</p>
                    <p>
                        <span>271 点评</span>
                    </p>
                    <p>￥ {data.price}</p>
                </div>
            </div>
        </>
    );
}

export default Project;
